package com.liang.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.liang.entity.CUserDetail;
import com.liang.mapper.CUserDetailMapper;
import com.liang.service.CUserDetailService;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author 李昂
 * @since 2020-11-30
 */
@Service
public class CUserDetailServiceImpl extends ServiceImpl<CUserDetailMapper, CUserDetail> implements CUserDetailService {
    /**
     * @Author 李昂
     * @Description 补充用户信息和修改用户信息
     * @Date 2020/12/9 16:20
     */
    @Override
    @CacheEvict(value = "change", allEntries = true)
    public boolean updateUserMsg(String id, CUserDetail userDetail) {
        LambdaQueryWrapper<CUserDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
        lambdaQueryWrapper.eq(CUserDetail::getId, id);
        return this.update(userDetail, lambdaQueryWrapper);
    }
}
